﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Sinacor.Infra.Common.Caching;
using Sinacor.Infra.Common.Validation;
using Sinacor.Infra.Service.Data;

namespace Sinacor.Infra.Service.ExceptionHandling
{
    public class ValidationErrorFactory
    {
        protected ValidationErrorFactory()
        { 
        }

        public static ValidationError CreateValidationError(int errorNumber, params object[] parameters)
        {
            string resourceKey;
            string errorMessage = ErrorMessage.RetrieveErrorMessage(errorNumber, out resourceKey, parameters);
            
            return new ValidationError(errorNumber, errorMessage, resourceKey, parameters.ToList());
        }

        
    }
}
